import util
import os

if __name__ == "__main__":
    path = "/home/ubuntu/onnx_samples/onnx_transformer/docter/constraints/tensorflow"
    model_path = "/home/ubuntu/onnx_samples/onnx_transformer/onnx_models/tensorflow"
    target_path = "/home/ubuntu/onnx_samples/onnx_transformer/docter/constraints/tf_transferred"
    # handled_path = "/home/ubuntu/onnx_samples/onnx_transformer/docter/constraints/pytorch"
    # constructor_path = "/home/ubuntu/onnx_samples/onnx_transformer/docter/constraints/pytorch_constructor"
    for file_name in os.listdir(path):
        constraint_path = os.path.join(path, file_name)
        target_config = util.read_yaml(os.path.abspath(constraint_path))
        all_name = target_config.get("title")
        if os.path.exists(os.path.join(model_path, "%s.onnx" % all_name)):
            os.system("mv %s %s" % (constraint_path, target_path))


